<%@ taglib prefix="page" uri="http://com.qipay/pagelib" %>
<%@ page language="java" import="com.qipay.admin.card.vo.CardBindVo" contentType="text/html;charset=utf-8" %>
<!doctype html>
<html>
<head>
    <jsp:include page="head.jsp"></jsp:include>
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/dataTables.bootstrap.min.css">
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/bootstrapValidator.min.css">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <jsp:include page="nav.jsp"></jsp:include>
    <jsp:include page="left.jsp"></jsp:include>
    <div class="content-wrapper">
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box box-info">
                        <div class="box-header with-border">
                            <h3 class="box-title">绑定银行卡明细</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form action="/card/bind" id="cardForm" method="POST">
                            <div class="box-body" id="divContent">
                                <%
                                    CardBindVo detail = (CardBindVo) request.getAttribute("detail");
                                %>
                                <input type="hidden" id="id" name="id" value="<%=detail.getId()%>">
                                <input type="hidden" id="userId" name="userId" value="<%=detail.getUserId()%>">
                                <div class="form-group">
                                    <label for="bank">银行名称</label>
                                    <input type="text"
                                           class="form-control col-xs-6 col-md-6 col-lg-6"
                                           id="bank"
                                           name="bank"
                                           placeholder="银行名称"
                                           value="<%=detail.getBank()%>">
                                </div>
                                <div class="form-group">
                                    <label for="bank">支行名称</label>
                                    <input type="text"
                                           class="form-control col-xs-6 col-md-6 col-lg-6"
                                           id="subBank"
                                           name="subBank"
                                           placeholder="支行名称"
                                           value="<%=detail.getSubBank()%>">
                                </div>
                                <div class="form-group"><label for="card">卡号</label><input type="text"
                                                                                           class="form-control"
                                                                                           id="card"
                                                                                           name="card"
                                                                                           value="<%=detail.getCard()%>">
                                </div>
                                <div class="form-group"><label for="name">姓名</label><input type="text"
                                                                                           class="form-control"
                                                                                           id="name"
                                                                                           name="name"
                                                                                           value="<%=detail.getName()%>">
                                </div>
                                <div class="form-group"><label for="mobile">银行预留手机号</label><input type="text"
                                                                                                  class="form-control"
                                                                                                  id="mobile"
                                                                                                  name="mobile"
                                                                                                  value="<%=detail.getMobile()%>">
                                </div>
                                <!-- /.box-body -->
                                <div class="box-footer">
                                    <button type="button" class="btn btn-default" onclick="window.history.back()">返回
                                    </button>
                                    <button type="submit" class="button back-gray">确认</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <jsp:include page="foot.jsp"></jsp:include>
</div>
<script src="<%= request.getAttribute("StaticHost") %>/js/adminlte.min.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/bootstrapValidator.min.js"></script>
<script type="text/javascript">
    $('#cardForm').bootstrapValidator({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            bank: {
                validators: {
                    notEmpty: {
                        message: '所属银行不能为空'
                    }
                }
            },
            subBank: {
                validators: {
                    notEmpty: {
                        message: '所属银行不能为空'
                    }
                }
            },
            card: {
                validators: {
                    notEmpty: {
                        message: '卡号不能为空'
                    }, stringLength: {
                        min: 16,
                        max: 19,
                        message: '银行卡位数有误'
                    },
                }
            },
            name: {
                validators: {
                    notEmpty: {
                        message: '银行卡持有人姓名不能为空'
                    },
                }
            },
            mobile: {
                validators: {
                    notEmpty: {
                        message: '银行预留手机号不能为空'
                    },
                    regexp: {
                        regexp: /^[0-9]{11}$/,
                        message: '手机号位数有误'
                    }
                }
            },
        }
    });
</script>
</body>
</html>

